import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { LoginComponent } from './common/component/login/login.component';
import { DesktopComponent } from './common/component/desktop/desktop.component';
import { Page404Component } from './common/component/404/page404.component';
import { QkMapComponent } from './common/component/map/qkmap.component';
import { AuthorityGuard } from './common/interceptor/authority.guard';

const routes: Routes = [
    /** 登录界面  */
    { path: '', component: LoginComponent },
    /** 桌面 */
    { path: 'desktop', canActivate: [ AuthorityGuard ], component: DesktopComponent },
    /** 系统构建 */
    { path: 'system', loadChildren: './system/system.module#SystemModule' },
    /** 表单构建 */
    { path: 'form', loadChildren: './form/form.module#FormModule' },
    /** 自由流构建 */
    { path: 'freeflow', loadChildren: './freeflow/freeflow.module#FreeflowModule' },
    /** 运维监控平台 */
    { path: 'monitor', loadChildren: './monitor/monitor.module#MonitorModule' },
    /** 大屏监控平台 */
    { path: 'screen', loadChildren: './screen/screen.module#ScreenModule' },
    /** 定时任务 */
    { path: 'schedule', loadChildren: './schedule/schedule.module#ScheduleModule' },
    /** 基本业务配置 */
    { path: 'custom', loadChildren: './custom/custom.module#CustomModule' },
    /** 统计业务配置 */
    { path: 'report', loadChildren: './report/report.module#ReportModule' },
    /** 地图 */
    { path: 'map', component: QkMapComponent },
    /** 404 */
    { path: '**', component: Page404Component }
];

@NgModule({
    imports: [RouterModule.forRoot(routes)],
    exports: [RouterModule]
})
export class AppRoutingModule {
}
